package mk.jug.cloud.cms.controller;

import mk.jug.cloud.cms.model.Article;
import mk.jug.cloud.cms.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.UUID;

/**
 * Created by IntelliJ IDEA.
 * User: Ice.Penov
 * Date: 6/8/11
 * Time: 2:12 PM
 * To change this template use File | Settings | File Templates.
 */
@Controller
public class ArticleController {

    @Autowired private ArticleService articleService;

    @RequestMapping("/welcome.do")
    public String welcome() {
        Article article = new Article();
        article.setTitle("Title [ " + UUID.randomUUID() + " ]");
        article.setContents("Contents [ " + UUID.randomUUID() + " ]");
        articleService.create(article);
        return "public.test";
    }

}